<html xmlns="http://www.w3.org/1999/xhtml"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:ice="http://www.icesoft.com/icefaces/component"
    xmlns:ui="http://java.sun.com/jsf/facelets"
    xmlns:c="http://java.sun.com/jstl/core"
    xmlns:icefusion="http://icefusion.googlecode.com/icefusion">
<body>
<ui:component>
    <ice:form>
	    <ui:repeat value="#{value}" var="mainItem">
            <ice:commandLink actionListener="#{mainItem.processAction}" 
                value="#{mainItem.label}" rendered="#{! mainItem.hasSubMenu}" />
	        <ice:panelCollapsible toggleOnClick="true" rendered="#{mainItem.hasSubMenu}">
	            <f:facet name="header">
                    <ice:outputText value="#{mainItem.label}"/>
	            </f:facet>
	            <ice:panelGrid columns="1">
		            <ui:repeat value="#{mainItem.subMenu}" var="subItem">
		                <ice:commandLink actionListener="#{subItem.processAction}" 
                            value="#{subItem.label}" /><br />
		            </ui:repeat>
                </ice:panelGrid>
	        </ice:panelCollapsible>        
	    </ui:repeat>
    </ice:form>
</ui:component>
</body>
</html>